package com.hangzhou.welbeing.welbeinginstrument.factory;

import android.support.v4.app.Fragment;

import com.hangzhou.welbeing.welbeinginstrument.fragement.releaseHotFragment;
import com.hangzhou.welbeing.welbeinginstrument.fragement.releaseNewsFragment;

import java.util.HashMap;

/**
 * 杭州惟君医疗科技有限公司14
 * Created by 20433 on 2018/2/1
 */

public class ReleaseTrueCicleFragmentFactory {
    private static final int HOT = 0;
    private static final int NEWS = 1; //Attention
    private static HashMap<Integer, Fragment> mapAllCircle = new HashMap();
    public static Fragment CreateCircleObject(int position) {
        Fragment fragment = mapAllCircle.get(position);
        if (fragment == null) {
            switch (position) {
                case HOT:
                    fragment = new releaseHotFragment();
                    break;
                case NEWS:
                    fragment = new releaseNewsFragment();
                    break;
            }
            mapAllCircle.put(position, fragment);
            return fragment;
        }
        return fragment;
    }
}
